#pragma once

typedef size_t filepathlengthsize_t;
typedef uint64_t filesize_t;

struct FileInfo
{
	TCHAR absolutepath[MAX_PATH];
	TCHAR relativepath[MAX_PATH];
	filesize_t size;
};

class FileIO
{
public:
	static TCHAR* getSavePath();
	static void setSavePath(const TCHAR spath[MAX_PATH]);
	static filepathlengthsize_t getSavePathLength();
private:
	static TCHAR _savepath[MAX_PATH];
	static filepathlengthsize_t _savepathlength;

public:
	~FileIO();

public:
	void CreateFullPath(const TCHAR path[MAX_PATH]);
	int Open_Sender(const FileInfo* pfi);
	int Open_Receiver(FileInfo* pfi);
	int Read(void* buff, int bytecount);
	int Write(void* buff, int bytecount);
	void Close();

private:
	FILE* _fp;
};